void ArrowDz(CRGB *leds_dz)
{
    // leds_dz[1] = color;          // 设置灯带中第一个灯珠颜色为红色，leds_dz[0]为第一个灯珠，leds_dz[1]为第二个灯珠
    for (int i = 0; i <= 14; i++)
    {
        leds_dz[0 + i * 32] = color;
        leds_dz[1 + i * 32] = color;
        leds_dz[14 + i * 32] = color;
        leds_dz[7 + i * 32] = color;
        leds_dz[8 + i * 32] = color;
        leds_dz[9 + i * 32] = color;
        leds_dz[10 + i * 32] = color;
        leds_dz[13 + i * 32] = color;
        leds_dz[14 + i * 32] = color;
        leds_dz[15 + i * 32] = color;
        leds_dz[17 + i * 32] = color;
        leds_dz[18 + i * 32] = color;
        leds_dz[19 + i * 32] = color;
        leds_dz[20 + i * 32] = color;
        leds_dz[21 + i * 32] = color;
        leds_dz[22 + i * 32] = color;
        leds_dz[26 + i * 32] = color;
        leds_dz[27 + i * 32] = color;
        leds_dz[28 + i * 32] = color;
        leds_dz[29 + i * 32] = color;
        leds_dz[35 + i * 32] = color;
        leds_dz[36 + i * 32] = color;
    }
    leds_dz[3] = color;
    leds_dz[4] = color;
    leds_dz[0 + 60 * 8] = color;
    leds_dz[1 + 60 * 8] = color;
    leds_dz[6 + 60 * 8] = color;
    leds_dz[7 + 60 * 8] = color;
    leds_dz[0 + 61 * 8] = color;
    leds_dz[1 + 61 * 8] = color;
    leds_dz[2 + 61 * 8] = color;
    leds_dz[5 + 61 * 8] = color;
    leds_dz[6 + 61 * 8] = color;
    leds_dz[7 + 61 * 8] = color;
    leds_dz[1 + 62 * 8] = color;
    leds_dz[2 + 62 * 8] = color;
    leds_dz[5 + 62 * 8] = color;
    leds_dz[6 + 62 * 8] = color;
    leds_dz[3 + 62 * 8] = color;
    leds_dz[4 + 62 * 8] = color;
    leds_dz[2 + 63 * 8] = color;
    leds_dz[3 + 63 * 8] = color;
    leds_dz[4 + 63 * 8] = color;
    leds_dz[5 + 63 * 8] = color;
    FastLED.show(); // 更新LED色彩      //////////////////循环1
    vTaskDelay(75);
    for (int i = 0; i < NUM_dz; i++)
    {
        leds_dz[i] = CRGB::Black; // 设i置灯带中全部灯珠熄灭
    }
    for (int i = 0; i <= 14; i++)
    {
        leds_dz[0 + i * 32 + 8] = color;
        leds_dz[1 + i * 32 + 8] = color;
        leds_dz[6 + i * 32 + 8] = color;
        leds_dz[7 + i * 32 + 8] = color;
        leds_dz[8 + i * 32 + 8] = color;
        leds_dz[9 + i * 32 + 8] = color;
        leds_dz[10 + i * 32 + 8] = color;
        leds_dz[13 + i * 32 + 8] = color;
        leds_dz[14 + i * 32 + 8] = color;
        leds_dz[15 + i * 32 + 8] = color;
        leds_dz[17 + i * 32 + 8] = color;
        leds_dz[18 + i * 32 + 8] = color;
        leds_dz[19 + i * 32 + 8] = color;
        leds_dz[20 + i * 32 + 8] = color;
        leds_dz[21 + i * 32 + 8] = color;
        leds_dz[22 + i * 32 + 8] = color;
        leds_dz[26 + i * 32 + 8] = color;
        leds_dz[27 + i * 32 + 8] = color;
        leds_dz[28 + i * 32 + 8] = color;
        leds_dz[29 + i * 32 + 8] = color;
        leds_dz[35 + i * 32 + 8] = color;
        leds_dz[36 + i * 32 + 8] = color;
    }
    leds_dz[2] = color;
    leds_dz[3] = color;
    leds_dz[4] = color;
    leds_dz[5] = color;
    leds_dz[3 + 8] = color;
    leds_dz[4 + 8] = color;
    leds_dz[0 + 61 * 8] = color;
    leds_dz[1 + 61 * 8] = color;
    leds_dz[6 + 61 * 8] = color;
    leds_dz[7 + 61 * 8] = color;
    leds_dz[0 + 62 * 8] = color;
    leds_dz[1 + 62 * 8] = color;
    leds_dz[2 + 62 * 8] = color;
    leds_dz[5 + 62 * 8] = color;
    leds_dz[6 + 62 * 8] = color;
    leds_dz[7 + 62 * 8] = color;
    leds_dz[1 + 63 * 8] = color;
    leds_dz[2 + 63 * 8] = color;
    leds_dz[3 + 63 * 8] = color;
    leds_dz[4 + 63 * 8] = color;
    leds_dz[5 + 63 * 8] = color;
    leds_dz[6 + 63 * 8] = color;
    FastLED.show(); // 更新LED色彩 循环2
    vTaskDelay(75);
    for (int i = 0; i < NUM_dz; i++)
    {
        leds_dz[i] = CRGB::Black; // 设i置灯带中全部灯珠熄灭
    }
    for (int i = 0; i <= 14; i++)
    {

        leds_dz[0 + i * 32 + 16] = color;
        leds_dz[1 + i * 32 + 16] = color;
        leds_dz[6 + i * 32 + 16] = color;
        leds_dz[7 + i * 32 + 16] = color;
        leds_dz[8 + i * 32 + 16] = color;
        leds_dz[9 + i * 32 + 16] = color;
        leds_dz[10 + i * 32 + 16] = color;
        leds_dz[13 + i * 32 + 16] = color;
        leds_dz[14 + i * 32 + 16] = color;
        leds_dz[15 + i * 32 + 16] = color;
        leds_dz[17 + i * 32 + 16] = color;
        leds_dz[18 + i * 32 + 16] = color;
        leds_dz[19 + i * 32 + 16] = color;
        leds_dz[20 + i * 32 + 16] = color;
        leds_dz[21 + i * 32 + 16] = color;
        leds_dz[22 + i * 32 + 16] = color;
        leds_dz[26 + i * 32 + 16] = color;
        leds_dz[27 + i * 32 + 16] = color;
        leds_dz[28 + i * 32 + 16] = color;
        leds_dz[29 + i * 32 + 16] = color;
        leds_dz[35 + i * 32 + 16] = color;
        leds_dz[36 + i * 32 + 16] = color;
    }
    leds_dz[1] = color;
    leds_dz[2] = color;
    leds_dz[3] = color;
    leds_dz[4] = color;
    leds_dz[5] = color;
    leds_dz[6] = color;
    leds_dz[2 + 8] = color;
    leds_dz[3 + 8] = color;
    leds_dz[4 + 8] = color;
    leds_dz[5 + 8] = color;
    leds_dz[3 + 16] = color;
    leds_dz[4 + 16] = color;
    leds_dz[0 + 62 * 8] = color;
    leds_dz[1 + 62 * 8] = color;
    leds_dz[6 + 62 * 8] = color;
    leds_dz[7 + 62 * 8] = color;
    leds_dz[0 + 63 * 8] = color;
    leds_dz[1 + 63 * 8] = color;
    leds_dz[2 + 63 * 8] = color;
    leds_dz[5 + 63 * 8] = color;
    leds_dz[6 + 63 * 8] = color;
    leds_dz[7 + 63 * 8] = color;
    FastLED.show(); // 更新LED色彩
    vTaskDelay(75);
    for (int i = 0; i < NUM_dz; i++)
    {
        leds_dz[i] = CRGB::Black; // 设i置灯带中全部灯珠熄灭 循环3
    }
    for (int i = 0; i <= 14; i++)
    {

        leds_dz[0 + i * 32 + 24] = color;
        leds_dz[1 + i * 32 + 24] = color;
        leds_dz[6 + i * 32 + 24] = color;
        leds_dz[7 + i * 32 + 24] = color;
        leds_dz[8 + i * 32 + 24] = color;
        leds_dz[9 + i * 32 + 24] = color;
        leds_dz[10 + i * 32 + 24] = color;
        leds_dz[13 + i * 32 + 24] = color;
        leds_dz[14 + i * 32 + 24] = color;
        leds_dz[15 + i * 32 + 24] = color;
        leds_dz[17 + i * 32 + 24] = color;
        leds_dz[18 + i * 32 + 24] = color;
        leds_dz[19 + i * 32 + 24] = color;
        leds_dz[20 + i * 32 + 24] = color;
        leds_dz[21 + i * 32 + 24] = color;
        leds_dz[22 + i * 32 + 24] = color;
        leds_dz[26 + i * 32 + 24] = color;
        leds_dz[27 + i * 32 + 24] = color;
        leds_dz[28 + i * 32 + 24] = color;
        leds_dz[29 + i * 32 + 24] = color;
        leds_dz[35 + i * 32 + 24] = color;
        leds_dz[36 + i * 32 + 24] = color;
    }
    leds_dz[0] = color;
    leds_dz[1] = color;
    leds_dz[2] = color;
    leds_dz[5] = color;
    leds_dz[6] = color;
    leds_dz[7] = color;
    leds_dz[1 + 8] = color;
    leds_dz[2 + 8] = color;
    leds_dz[3 + 8] = color;
    leds_dz[4 + 8] = color;
    leds_dz[5 + 8] = color;
    leds_dz[6 + 8] = color;
    leds_dz[2 + 8 + 8] = color;
    leds_dz[3 + 8 + 8] = color;
    leds_dz[4 + 8 + 8] = color;
    leds_dz[5 + 8 + 8] = color;
    leds_dz[3 + 16 + 8] = color;
    leds_dz[4 + 16 + 8] = color;
    leds_dz[0 + 63 * 8] = color;
    leds_dz[1 + 63 * 8] = color;
    leds_dz[6 + 63 * 8] = color;
    leds_dz[7 + 63 * 8] = color;
    FastLED.show(); // 更新LED色彩
    vTaskDelay(75);
}
void IRAM_ATTR ISR_FANS_0()
{
    portENTER_CRITICAL(&mux);
    timerWrite(timer, 0); // 重置定时器，喂狗 (feed watchdog)
    hit_alarming = true;  //触发已经击中扇叶
    FAN_HIT = 0;          //被击中的是4号扇叶
    Serial.printf("FAN_HIT is:%d\tFAN_NUM is%d\n", FAN_HIT, FAN_NUM);
    if (FAN_HIT == FAN_NUM)
    {
        // Serial.println("ISR_FANS_4");
        FANS[FAN_HIT] = LIGHT; //被正确击中的扇叶变为2，即该扇叶可以完全点亮
    }
    else
    {
        fans_all_off();
    }
    for (int i = 0; i < 5; i++)
    {
        if (FANS[i] == HALF_LIGHT)
        {
            FANS[i] = OFF;
            // vTaskSuspend(handle_arrow); //暂停箭头任务
        }
        else
        {
            continue;
        }
    }
    if (order == 5)
    {
        order = 0;
    }
    state = !state;
    digitalWrite(LED_BUILTIN, state);
    FAN_NUM = FAN_order[order++];
    FANS[FAN_NUM] = HALF_LIGHT; //将扇叶数组中的这个待激活状态的扇叶置为一，将会在单独的一个线程中显示待激活的状态
    // vTaskResume(handle_arrow);  //重启箭头任务
    // hit_init(); //重新初始化所有的扇叶为可触发状态
    portEXIT_CRITICAL(&mux);
}
void IRAM_ATTR ISR_FANS_1()
{
    portENTER_CRITICAL(&mux);
    timerWrite(timer, 0); // 重置定时器，喂狗 (feed watchdog)
    hit_alarming = true;  //触发已经击中扇叶
    FAN_HIT = 1;          //被击中的是4号扇叶
    Serial.printf("FAN_HIT is:%d\tFAN_NUM is%d\n", FAN_HIT, FAN_NUM);
    if (FAN_HIT == FAN_NUM)
    {
        // Serial.println("ISR_FANS_4");
        FANS[FAN_HIT] = LIGHT; //被正确击中的扇叶变为2，即该扇叶可以完全点亮
    }
    else
    {
        fans_all_off();
    }
    for (int i = 0; i < 5; i++)
    {
        if (FANS[i] == HALF_LIGHT)
        {
            FANS[i] = OFF;
            // vTaskSuspend(handle_arrow); //暂停箭头任务
        }
        else
        {
            continue;
        }
    }
    if (order == 5)
    {
        order = 0;
    }
    state = !state;
    digitalWrite(LED_BUILTIN, state);
    FAN_NUM = FAN_order[order++];
    FANS[FAN_NUM] = HALF_LIGHT; //将扇叶数组中的这个待激活状态的扇叶置为一，将会在单独的一个线程中显示待激活的状态
    // vTaskResume(handle_arrow);  //重启箭头任务
    // hit_init(); //重新初始化所有的扇叶为可触发状态
    portEXIT_CRITICAL(&mux);
}
void IRAM_ATTR ISR_FANS_2()
{
    portENTER_CRITICAL(&mux);
    timerWrite(timer, 0); // 重置定时器，喂狗 (feed watchdog)
    hit_alarming = true;  //触发已经击中扇叶
    FAN_HIT = 2;          //被击中的是4号扇叶
    Serial.printf("FAN_HIT is:%d\tFAN_NUM is%d\n", FAN_HIT, FAN_NUM);
    if (FAN_HIT == FAN_NUM)
    {
        // Serial.println("ISR_FANS_4");
        FANS[FAN_HIT] = LIGHT; //被正确击中的扇叶变为2，即该扇叶可以完全点亮
    }
    else
    {
        fans_all_off();
    }
    for (int i = 0; i < 5; i++)
    {
        if (FANS[i] == HALF_LIGHT)
        {
            FANS[i] = OFF;
            // vTaskSuspend(handle_arrow); //暂停箭头任务
        }
        else
        {
            continue;
        }
    }
    if (order == 5)
    {
        order = 0;
    }
    state = !state;
    digitalWrite(LED_BUILTIN, state);
    FAN_NUM = FAN_order[order++];
    FANS[FAN_NUM] = HALF_LIGHT; //将扇叶数组中的这个待激活状态的扇叶置为一，将会在单独的一个线程中显示待激活的状态
    // vTaskResume(handle_arrow);  //重启箭头任务
    // hit_init(); //重新初始化所有的扇叶为可触发状态
    portEXIT_CRITICAL(&mux);
}
void IRAM_ATTR ISR_FANS_3()
{
    portENTER_CRITICAL(&mux);
    timerWrite(timer, 0); // 重置定时器，喂狗 (feed watchdog)
    hit_alarming = true;  //触发已经击中扇叶
    FAN_HIT = 3;          //被击中的是4号扇叶
    Serial.printf("FAN_HIT is:%d\tFAN_NUM is%d\n", FAN_HIT, FAN_NUM);
    if (FAN_HIT == FAN_NUM)
    {
        // Serial.println("ISR_FANS_4");
        FANS[FAN_HIT] = LIGHT; //被正确击中的扇叶变为2，即该扇叶可以完全点亮
    }
    else
    {
        fans_all_off();
    }
    for (int i = 0; i < 5; i++)
    {
        if (FANS[i] == HALF_LIGHT)
        {
            FANS[i] = OFF;
            // vTaskSuspend(handle_arrow); //暂停箭头任务
        }
        else
        {
            continue;
        }
    }
    if (order == 5)
    {
        order = 0;
    }
    state = !state;
    digitalWrite(LED_BUILTIN, state);
    FAN_NUM = FAN_order[order++];
    FANS[FAN_NUM] = HALF_LIGHT; //将扇叶数组中的这个待激活状态的扇叶置为一，将会在单独的一个线程中显示待激活的状态
    // vTaskResume(handle_arrow);  //重启箭头任务
    // hit_init(); //重新初始化所有的扇叶为可触发状态
    portEXIT_CRITICAL(&mux);
}
void IRAM_ATTR ISR_FANS_4()
{
    portENTER_CRITICAL(&mux);
    timerWrite(timer, 0); // 重置定时器，喂狗 (feed watchdog)
    hit_alarming = true;  //触发已经击中扇叶
    FAN_HIT = 4;          //被击中的是4号扇叶
    Serial.printf("FAN_HIT is:%d\tFAN_NUM is%d\n", FAN_HIT, FAN_NUM);
    if (FAN_HIT == FAN_NUM)
    {
        // Serial.println("ISR_FANS_4");
        FANS[FAN_HIT] = LIGHT; //被正确击中的扇叶变为2，即该扇叶可以完全点亮
    }
    else
    {
        fans_all_off();
    }
    for (int i = 0; i < 5; i++)
    {
        if (FANS[i] == HALF_LIGHT)
        {
            FANS[i] = OFF;
            // vTaskSuspend(handle_arrow); //暂停箭头任务
        }
        else
        {
            continue;
        }
    }
    if (order == 5)
    {
        order = 0;
    }
    state = !state;
    digitalWrite(LED_BUILTIN, state);
    FAN_NUM = FAN_order[order++];
    FANS[FAN_NUM] = HALF_LIGHT; //将扇叶数组中的这个待激活状态的扇叶置为一，将会在单独的一个线程中显示待激活的状态
    // vTaskResume(handle_arrow);  //重启箭头任务
    // hit_init(); //重新初始化所有的扇叶为可触发状态
    portEXIT_CRITICAL(&mux);
}